package com.hjl.spring6.tx.controller;

import com.hjl.spring6.tx.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;

/**
 * @author ServivE
 * @version 0.1
 * @className BookController
 * @description
 * @date 2024/8/7 20:47
 * @since jdk11
 */
@Controller
public class BookController {
    //注入service
    @Autowired
    private BookService bookService;

    //买书的方法:图书id和用户id
    public void buyBook(Integer bookId, Integer userId) {
        bookService.buyBook(bookId,userId);
    }
}
